import java.util.HashSet;
import java.util.Iterator;

public class KTV {
    public static void main(String[] args) {
        HashSet<String> hashSet = new HashSet<>();
        String[] arrry = new String[]{"小明", "小明", "小红", "小红"};

        for (int i = 0; i < arrry.length; i++) {
            System.out.println(arrry[i].hashCode());
            hashSet.add(arrry[i]);
        }
        Iterator<String> iterator = hashSet.iterator();
        while (iterator.hasNext())
            System.out.println(iterator.next());
    }

}
